knitr::opts_chunk$set(echo = FALSE)
### Create Output Directory ###
# if save_output = TRUE
if(params$save_output){
outfile_dir <- file.path(params$output_dir,"EpiCompare_file")
if(!dir.exists(outfile_dir)){
dir.create(outfile_dir, showWarnings = FALSE, recursive = TRUE)
}
}
#### ------ Prepare genome builds ------ ####
# e.g. genome_build <- list(reference="hg19",peakfiles="hg38",blacklist="hg19")
# or... genome_build <- "hg19"
builds <- prepare_genome_builds(genome_build = params$genome_build)
## Standardise all data to hg19 build
output_build <- prepare_output_build(params$genome_build_output)
#### ------ Prepare peaklist(s) ------ ####
# and check that the list is named, if not default filenames are used
peaklist <- prepare_peaklist(peaklist = params$peakfile)
peaklist <- liftover_grlist(grlist = peaklist,
input_build = builds$peaklist,
output_build = output_build)
#### ------ Prepare reference(s) ------ ####
reference <- prepare_reference(reference = params$reference)
reference <- liftover_grlist(grlist = reference,
input_build = builds$reference,
output_build = output_build)
#### ------ Prepare blacklist ------ ####
blacklist <- liftover_grlist(grlist = params$blacklist,
input_build = builds$blacklist,
output_build = output_build)
### Standardise peaklist(s) ###
peaklist_tidy <- tidy_peakfile(peaklist = peaklist,
blacklist = blacklist)
### Standardise reference(s) ###
# and include in peaklist
reference_tidy <- reference
if (!is.null(reference)){
reference_tidy <- tidy_peakfile(peaklist = reference,
blacklist = blacklist)
peaklist_tidy <- c(peaklist_tidy, reference_tidy)
}
### Obtain Genome Annotation ###
txdb <- check_genome_build(genome_build = output_build)
### Dynamic Figure Height ###
fig_height <- fig_length(default_size = 7,
number_of_items = length(peaklist_tidy),
max_items = 10)
EpiCompare compares epigenetic datasets for quality control and benchmarking purposes. The report consists of three sections:
## [1] "File1: CnR"
## [1] "File2: CnT"
## [1] "File3: ENCODE"
The function call used to create the report.
EpiCompare(peakfiles = list(CnR, CnT, ENCODE),
genome_build = hg19, hg19, hg19,
genome_build_output = hg19,
blacklist = blacklist,
picard_files = list(CnR, CnT),
reference = ENCODE,
upset_plot = FALSE,
stat_plot = FALSE,
chromHMM_plot = FALSE,
chromHMM_annotation = "K562",
chipseeker_plot = FALSE,
enrichment_plot = FALSE,
tss_plot = FALSE,
precision_recall_plot = FALSE,
corr_plot=FALSE,
interact = TRUE,
save_output = FALSE,
output_dir = "/tmp/RtmpHWCZfA")
Column Description:
BRGenomics::tidyChromosomes().NB: EpiCompare uses filtered peakfiles (i.e. datasets after removing peaks in blacklisted regions and non-standard chromosomes)
## --- Running peak_info() ---
## Done.
| PeakN Before Tidy | Blacklisted Peaks Removed (%) | Non-standard Peaks Removed (%) | PeakN After Tidy | |
|---|---|---|---|---|
| CnR | 2707 | 0.222 | 0 | 2701 |
| CnT | 1670 | 0.299 | 0 | 1665 |
Metrics on fragments is shown only if Picard summary is provided. See manual for help.
Column Description:
## --- Running fragment_info() ---
## Done.
| Mapped_Fragments | Duplication_Rate | Unique_Fragments | |
|---|---|---|---|
| CnR | 5523031 | 7.30 | 5120026 |
| CnT | 2293087 | 20.18 | 1830390 |
Percentage of overlapping peaks between samples. Hover over heatmap for percentage values.
N.B. How to interpret heatmap: [Samples in x-axis of heatmap] peaks in [Samples in y-axis of heatmap] peaks
Depending on the format of the reference file, EpiCompare outputs different plots:
Reference peakfile: ENCODE
Keys:
The first plot shows the balance between precision and recall across multiple peak calling stringency thresholds.
The second plot shows F1 score (a score that combines precision and recall) across the different peak calling calling stringency thresholds.
2*(precision*recall) / (precision+recall)
## NULL
## NULL
ChromHMM annotates and characterises peaks into different chromatin states. ChromHMM annotations used in EpiCompare were obtained from here.
Percentage of Sample peaks found in Reference peaks (Reference peakfile: ENCODE)
ChromHMM annotation of sample peaks found in reference peaks.
Percentage of Reference peaks found in Sample peaks (Reference peakfile: ENCODE)
ChromHMM annotation of reference peaks found in sample peaks.
EpiCompare uses ChIPseeker::annotatePeak() to annotate
peaks with the nearest gene and genomic regions where the peak is
located. The peaks are annotated with genes taken from human genome
annotations (hg19 or hg38) provided by Bioconductor.
EpiCompare performs KEGG pathway and GO enrichment analysis using
clusterProfiler. ChIPseeker::annotatePeak() is
first used to assign peaks to nearest genes. Biological themes amongst
the genes are identified using ontologies (KEGG and GO). The peaks are
annotated with genes taken from annotations of human genome (hg19 or
hg38) provided by Bioconductor.
This plots peaks that are mapping to transcriptional start sites (TSS). TSS regions are defined as the flanking sequence of the TSS sites. The frequency of peaks in downstream (-3000bp) and upstream (+3000bp) of TSS is plotted. Faint color line around the main frequency line represents the 95% confidence interval estimated by bootstrap method.
## [1] FALSE
## R version 4.2.0 (2022-04-22)
## Platform: x86_64-pc-linux-gnu (64-bit)
## Running under: Ubuntu 20.04.4 LTS
##
## Matrix products: default
## BLAS: /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3
## LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/liblapack.so.3
##
## locale:
## [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
## [3] LC_TIME=en_US.UTF-8 LC_COLLATE=C
## [5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
## [7] LC_PAPER=en_US.UTF-8 LC_NAME=C
## [9] LC_ADDRESS=C LC_TELEPHONE=C
## [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
##
## attached base packages:
## [1] stats graphics grDevices utils datasets methods base
##
## other attached packages:
## [1] EpiCompare_0.99.20
##
## loaded via a namespace (and not attached):
## [1] utf8_1.2.2
## [2] tidyselect_1.1.2
## [3] htmlwidgets_1.5.4
## [4] RSQLite_2.2.14
## [5] AnnotationDbi_1.59.1
## [6] grid_4.2.0
## [7] BiocParallel_1.31.8
## [8] scatterpie_0.1.7
## [9] munsell_0.5.0
## [10] ragg_1.2.2
## [11] codetools_0.2-18
## [12] withr_2.5.0
## [13] colorspace_2.0-3
## [14] GOSemSim_2.23.0
## [15] Biobase_2.57.1
## [16] filelock_1.0.2
## [17] highr_0.9
## [18] knitr_1.39
## [19] rstudioapi_0.13
## [20] stats4_4.2.0
## [21] DOSE_3.23.2
## [22] MatrixGenerics_1.9.0
## [23] GenomeInfoDbData_1.2.8
## [24] polyclip_1.10-0
## [25] seqPattern_1.29.0
## [26] bit64_4.0.5
## [27] farver_2.1.0
## [28] rprojroot_2.0.3
## [29] vctrs_0.4.1
## [30] treeio_1.21.0
## [31] generics_0.1.2
## [32] xfun_0.31
## [33] BiocFileCache_2.5.0
## [34] R6_2.5.1
## [35] GenomeInfoDb_1.33.3
## [36] graphlayouts_0.8.0
## [37] locfit_1.5-9.5
## [38] bitops_1.0-7
## [39] BRGenomics_1.9.0
## [40] cachem_1.0.6
## [41] fgsea_1.23.0
## [42] gridGraphics_0.5-1
## [43] DelayedArray_0.23.0
## [44] assertthat_0.2.1
## [45] promises_1.2.0.1
## [46] BiocIO_1.7.1
## [47] scales_1.2.0
## [48] ggraph_2.0.5
## [49] enrichplot_1.17.0
## [50] gtable_0.3.0
## [51] downlit_0.4.0
## [52] processx_3.6.0
## [53] tidygraph_1.2.1
## [54] rlang_1.0.2
## [55] genefilter_1.79.0
## [56] systemfonts_1.0.4
## [57] splines_4.2.0
## [58] rtracklayer_1.57.0
## [59] lazyeval_0.2.2
## [60] impute_1.71.0
## [61] BiocManager_1.30.18
## [62] yaml_2.3.5
## [63] reshape2_1.4.4
## [64] crosstalk_1.2.0
## [65] GenomicFeatures_1.49.5
## [66] httpuv_1.6.5
## [67] qvalue_2.29.0
## [68] tools_4.2.0
## [69] gridBase_0.4-7
## [70] ggplotify_0.1.0
## [71] ggplot2_3.3.6
## [72] ellipsis_0.3.2
## [73] gplots_3.1.3
## [74] jquerylib_0.1.4
## [75] RColorBrewer_1.1-3
## [76] BiocGenerics_0.43.0
## [77] Rcpp_1.0.8.3
## [78] plyr_1.8.7
## [79] progress_1.2.2
## [80] zlibbioc_1.43.0
## [81] purrr_0.3.4
## [82] RCurl_1.98-1.7
## [83] ps_1.7.0
## [84] prettyunits_1.1.1
## [85] viridis_0.6.2
## [86] S4Vectors_0.35.1
## [87] SummarizedExperiment_1.27.1
## [88] ggrepel_0.9.1
## [89] fs_1.5.2
## [90] magrittr_2.0.3
## [91] data.table_1.14.2
## [92] DO.db_2.9
## [93] whisker_0.4
## [94] matrixStats_0.62.0
## [95] hms_1.1.1
## [96] patchwork_1.1.1
## [97] mime_0.12
## [98] evaluate_0.15
## [99] xtable_1.8-4
## [100] XML_3.99-0.10
## [101] IRanges_2.31.0
## [102] gridExtra_2.3
## [103] compiler_4.2.0
## [104] biomaRt_2.53.2
## [105] tibble_3.1.7
## [106] KernSmooth_2.23-20
## [107] crayon_1.5.1
## [108] shadowtext_0.1.2
## [109] htmltools_0.5.2
## [110] tzdb_0.3.0
## [111] ggfun_0.0.6
## [112] later_1.3.0
## [113] tidyr_1.2.0
## [114] geneplotter_1.75.0
## [115] aplot_0.1.6
## [116] DBI_1.1.2
## [117] tweenr_1.0.2
## [118] ChIPseeker_1.33.1
## [119] genomation_1.29.0
## [120] dbplyr_2.2.0
## [121] MASS_7.3-57
## [122] rappdirs_0.3.3
## [123] boot_1.3-28
## [124] readr_2.1.2
## [125] Matrix_1.4-1
## [126] cli_3.3.0
## [127] parallel_4.2.0
## [128] igraph_1.3.1
## [129] GenomicRanges_1.49.0
## [130] pkgconfig_2.0.3
## [131] TxDb.Hsapiens.UCSC.hg19.knownGene_3.2.2
## [132] pkgdown_2.0.4.9000
## [133] GenomicAlignments_1.33.0
## [134] plotly_4.10.0
## [135] xml2_1.3.3
## [136] ggtree_3.5.0
## [137] annotate_1.75.0
## [138] bslib_0.3.1
## [139] XVector_0.37.0
## [140] yulab.utils_0.0.4
## [141] stringr_1.4.0
## [142] callr_3.7.0
## [143] digest_0.6.29
## [144] Biostrings_2.65.1
## [145] rmarkdown_2.14
## [146] fastmatch_1.1-3
## [147] tidytree_0.3.9
## [148] restfulr_0.0.14
## [149] curl_4.3.2
## [150] shiny_1.7.1
## [151] Rsamtools_2.13.3
## [152] gtools_3.9.2.1
## [153] rjson_0.2.21
## [154] lifecycle_1.0.1
## [155] nlme_3.1-157
## [156] jsonlite_1.8.0
## [157] BSgenome_1.65.1
## [158] desc_1.4.1
## [159] viridisLite_0.4.0
## [160] fansi_1.0.3
## [161] pillar_1.7.0
## [162] lattice_0.20-45
## [163] KEGGREST_1.37.2
## [164] fastmap_1.1.0
## [165] httr_1.4.3
## [166] plotrix_3.8-2
## [167] survival_3.3-1
## [168] GO.db_3.15.0
## [169] interactiveDisplayBase_1.35.0
## [170] glue_1.6.2
## [171] png_0.1-7
## [172] BiocVersion_3.16.0
## [173] bit_4.0.4
## [174] sass_0.4.1
## [175] ggforce_0.3.3
## [176] stringi_1.7.6
## [177] blob_1.2.3
## [178] textshaping_0.3.6
## [179] DESeq2_1.37.0
## [180] AnnotationHub_3.5.0
## [181] caTools_1.18.2
## [182] memoise_2.0.1
## [183] dplyr_1.0.9
## [184] ape_5.6-2